package com.wxb.cardmis.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * All rights Reserved, Designed By www.super-master.cn
 *
 * @ProjectName: cardmis
 * @Package: com.wxb.cardmis.entity
 * @ClassName: UserEntity
 * <p> </p>
 * @Author: [Wei Xiao]
 * @Date: 2022/2/21 17:10
 * @Version: V1.0
 * @Copyright: 2022  com.wei All rights reserved.
 * TODO: 注意,本文件Wei Xiao所作,如果转载或使用请标明具体出处!
 * @Date: 2022年02月21日 17:10
 * @Description: []
 **/
@Entity
@Table(name = "user_table")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer"})
public class UserEntity implements Serializable {
    private static final long serialVersionUTD= 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private String uname;
    private String upwd;
    //名片列表,用户名与名片 是 一对多 关系
    @OneToMany(
            mappedBy = "user",
            cascade = CascadeType.ALL,
            targetEntity = CardEntity.class,
            fetch = FetchType.LAZY
    )
    private List<CardEntity> cardEntityList;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getUpwd() {
        return upwd;
    }

    public void setUpwd(String upwd) {
        this.upwd = upwd;
    }

    public List<CardEntity> getCardEntityList() {
        return cardEntityList;
    }

    public void setCardEntityList(List<CardEntity> cardEntityList) {
        this.cardEntityList = cardEntityList;
    }
}
